package com.matt.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tuo51.foudation.model.Model;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @author mengzhichao
 * @create 2025-02-20-10:44
 */
@Entity
@Data
@Table(name = "children_leave_request")
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class ChildrenLeaveRequest extends Model {

    //宝宝id
    @Column(name = "chldrenId")
    private String chldrenId;

    //班级id
    @Column(name = "classesId")
    private String classesId;

    //开始时间
    @Column(name = "startTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+08:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date startTime;

    //结束时间
    @Column(name = "endTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+08:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date endTime;

    //请假内容
    @Column(name = "leaveContent")
    private String leaveContent;

    //类型
    @Column(columnDefinition = "int COMMENT '请假类型' default 0")
    private Integer type;

    //宝宝姓名
    @Column(name = "name")
    private String name;

    //状态（0.未确认，1.已确认，2.已取消,3已撤销）
    @Column(name = "state")
    private String state;

    //宝宝关联课程id
    @Column(name = "courseProductId")
    private String courseProductId;

    //宝宝关联课程
    @Column(name = "courseProductName")
    private String courseProductName;

    //请假类型（0正常请假，1课程请假）
    @Column(name = "leaveType")
    private String leaveType;

    //创建时间
    @Column(name = "createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    //createUserId 创建用户id
    @Column(name = "createUserId")
    private String createUserId;

    //createUserName 创建人姓名
    @Column(name = "createUserName")
    private String createUserName;

    //所属园区
    @Column(name = "aid")
    private String aid;

    @Transient
    private String classesName;
}
